package com.clover.framework.exception;

/**
 * 系统异常
 * @Author masl - 2018/6/30 0030 18:13
 */
public class ApplicationException extends RuntimeException {
    private String code;

    public ApplicationException(ErrorCode errorCode, Throwable cause) {
        super(errorCode.getDesc(), cause);
        this.code = errorCode.getCode();
    }

    public ApplicationException(ErrorCode errorCode) {
        super(errorCode.getDesc());
        this.code = errorCode.getCode();
    }

    public ApplicationException(String message) {
        super(message);
    }

    public String getCode() {
        return this.code;
    }
}
